package com.cjb.eighteenart.controller;

import com.cjb.eighteenart.util.MsgAPIUtil;
import jakarta.mail.MessagingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.crypto.spec.OAEPParameterSpec;

/**
 * @Author chenjinbin
 * @Package IntelliJ IDEA
 * @Class SendController
 * @Date 2024-03-15 19:25
 */
@RestController
@RequestMapping(value = {"email"})
public class SendController {


    @Autowired
    private MsgAPIUtil msgAPIUtil;

    @GetMapping("cc")
    private String  Test(){
        System.out.println("接收了信息");
        try {
            msgAPIUtil.contextLoads("主题","接收的信息","2213859123@qq.com");
        } catch (MessagingException e) {
            System.out.println("发送邮箱发生异常");
        }
        return "";
    }
    @GetMapping("test")
    private String  Test1(){
        System.out.println("接收了信息");
        String goodsName = "积少成多";
        int page = 1;
        int pageSize = 10;
        msgAPIUtil.searchGoods(goodsName, page,pageSize);
        return "";
    }

}
